using lucere.entity;

namespace lucere.index.read
{
    public interface ISegmentTermEnumerator : ITermEnumerator
    {
        IFieldInfos FieldInfos { get; } 
        long Size { get; } 
        long Position { get; } 
        long IndexPointer { get; } 
        int IndexInterval { get; } 
        int SkipInterval { get; } 
        int MaxSkipLevels { get; } 
        
        void Seek(long pointer, long p, ITerm t, ITermInfo ti);

        /// <summary>
        /// Optimized scan, without allocating new terms.  Return number of invocations to next().
        /// </summary>
        /// <param name="term"></param>
        /// <returns></returns>
        int ScanTo(ITerm term);
      
        /// <summary>
        /// Returns the previous Term enumerated. Initially null.
        /// </summary>
        /// <returns></returns>
        ITerm Previous { get; } 
      
        /// <summary>
        /// Returns the current TermInfo in the enumeration. Initially invalid, valid after next() 
        /// called for the first time.
        /// </summary>
        /// <returns></returns>
        ITermInfo TermInfo { get; } 

        /// <summary>
        /// Sets the argument to the current TermInfo in the enumeration. Initially invalid, valid
        /// after next() called for the first time.
        /// </summary>
        /// <param name="ti"></param>
        void GetTermInfo(ITermInfo ti);

        /// <summary>
        /// Returns the freqPointer from the current TermInfo in the enumeration. Initially invalid,
        /// valid after next() called for the first time.
        /// </summary>
        /// <returns></returns>
        long FrequencyPointer { get; }

        /// <summary>
        /// Returns the proxPointer from the current TermInfo in the enumeration. Initially invalid, 
        /// valid after next() called for the first time.
        /// </summary>
        /// <returns></returns>
        long ProximityDataPointer { get; } 
    }
}